/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.tcc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;


/**
 *
 * @author danilo.santos
 */
public class Conexao {

    private static Connection conn;

    public static Connection getConexao(){

        try {
             Class.forName("com.mysql.jdbc.Driver");
             conn = DriverManager.getConnection(
      				"jdbc:mysql://localhost:3306/bd_seguradora_hom", 	//banco de dados 
     				"root", 	  									//usuario
     				"admin");										//senha
              
             
             System.out.println("Conexão bem sucedida!");
        } catch (SQLException ex) {
            ex.printStackTrace();
        }catch (ClassNotFoundException ex) {
            ex.printStackTrace();
        }
        
        return conn;
    }

}
